package com.sj.uabrowser.db.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.sj.uabrowser.db.AppData;
import com.sj.uabrowser.db.CollectHistory;
import com.sj.uabrowser.db.FileInfo;
import com.sj.uabrowser.db.Search;
import com.sj.uabrowser.db.TabRecrd;
import com.sj.uabrowser.db.ThreadInfo;

import com.sj.uabrowser.db.gen.AppDataDao;
import com.sj.uabrowser.db.gen.CollectHistoryDao;
import com.sj.uabrowser.db.gen.FileInfoDao;
import com.sj.uabrowser.db.gen.SearchDao;
import com.sj.uabrowser.db.gen.TabRecrdDao;
import com.sj.uabrowser.db.gen.ThreadInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig appDataDaoConfig;
    private final DaoConfig collectHistoryDaoConfig;
    private final DaoConfig fileInfoDaoConfig;
    private final DaoConfig searchDaoConfig;
    private final DaoConfig tabRecrdDaoConfig;
    private final DaoConfig threadInfoDaoConfig;

    private final AppDataDao appDataDao;
    private final CollectHistoryDao collectHistoryDao;
    private final FileInfoDao fileInfoDao;
    private final SearchDao searchDao;
    private final TabRecrdDao tabRecrdDao;
    private final ThreadInfoDao threadInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        appDataDaoConfig = daoConfigMap.get(AppDataDao.class).clone();
        appDataDaoConfig.initIdentityScope(type);

        collectHistoryDaoConfig = daoConfigMap.get(CollectHistoryDao.class).clone();
        collectHistoryDaoConfig.initIdentityScope(type);

        fileInfoDaoConfig = daoConfigMap.get(FileInfoDao.class).clone();
        fileInfoDaoConfig.initIdentityScope(type);

        searchDaoConfig = daoConfigMap.get(SearchDao.class).clone();
        searchDaoConfig.initIdentityScope(type);

        tabRecrdDaoConfig = daoConfigMap.get(TabRecrdDao.class).clone();
        tabRecrdDaoConfig.initIdentityScope(type);

        threadInfoDaoConfig = daoConfigMap.get(ThreadInfoDao.class).clone();
        threadInfoDaoConfig.initIdentityScope(type);

        appDataDao = new AppDataDao(appDataDaoConfig, this);
        collectHistoryDao = new CollectHistoryDao(collectHistoryDaoConfig, this);
        fileInfoDao = new FileInfoDao(fileInfoDaoConfig, this);
        searchDao = new SearchDao(searchDaoConfig, this);
        tabRecrdDao = new TabRecrdDao(tabRecrdDaoConfig, this);
        threadInfoDao = new ThreadInfoDao(threadInfoDaoConfig, this);

        registerDao(AppData.class, appDataDao);
        registerDao(CollectHistory.class, collectHistoryDao);
        registerDao(FileInfo.class, fileInfoDao);
        registerDao(Search.class, searchDao);
        registerDao(TabRecrd.class, tabRecrdDao);
        registerDao(ThreadInfo.class, threadInfoDao);
    }
    
    public void clear() {
        appDataDaoConfig.clearIdentityScope();
        collectHistoryDaoConfig.clearIdentityScope();
        fileInfoDaoConfig.clearIdentityScope();
        searchDaoConfig.clearIdentityScope();
        tabRecrdDaoConfig.clearIdentityScope();
        threadInfoDaoConfig.clearIdentityScope();
    }

    public AppDataDao getAppDataDao() {
        return appDataDao;
    }

    public CollectHistoryDao getCollectHistoryDao() {
        return collectHistoryDao;
    }

    public FileInfoDao getFileInfoDao() {
        return fileInfoDao;
    }

    public SearchDao getSearchDao() {
        return searchDao;
    }

    public TabRecrdDao getTabRecrdDao() {
        return tabRecrdDao;
    }

    public ThreadInfoDao getThreadInfoDao() {
        return threadInfoDao;
    }

}
